from django.shortcuts import render
from models import BookInfo
from models import HeroInfo
# Create your views here.
def index(request):
    bookList = BookInfo.books.get_queryset().filter(pk__lt = 3 )
    return render(request,'booktest/index.html',{'bookList':bookList})

def hero(request,id):
    heroInfo = HeroInfo.objects.filter(hbook=id).values('hname','hcontent')
    # print(heroInfo)
    return render(request,'booktest/hero.html',{'heroInfo':heroInfo})